<div>
    <ul>
        <?php foreach($menu As $item): ?>
            <li><h2><?php print $item['name']; ?></h2>
                <?php if($item['parent'] != null): ?>
                <ul>
                    <?php foreach($item['parent'] As $row): ?>
                        <?php if($row['is_link']): ?>
                            <li><a href="javascript:void(0);" class="choose-value" rel="<?php print $row['link']; ?>"><?php print $row['name']; ?></a></li>
                        <?php else: ?>
                            <li><a href="<?php print site_url($row['link']); ?>" class="popup-page"><?php print $row['name']; ?></a></li>
                        <?php endif; ?>
                    <?php endforeach; ?>
                </ul>
                <?php endif;?>
            </li>
        <?php endforeach; ?>
    </ul>
</div>